<?php
class ServicesController extends AppController {
	public $uses = array('User');
	public $components = array('RequestHandler');
	
	public function beforeFilter() {
		$this->Auth->allow(array('check_username'));
		
		$this->layout = "services";
	}
	
	public function check_username() {
		$result = false;
			
		if ($this->request->is('get')) {
			$dataGet = $this->request->query;
			
			$userName = isset($dataGet['user_name']) ? $dataGet['user_name'] : '';
			
			$userInfo = $this->User->findByUserName($userName);
			
			if (empty($userInfo)) {
				$result = false;
			}
		}
		
		$this->set(compact('result'));
	}
	
	public function check_email() {
		
	}
}